<template>
  <div>
      life
  </div>
  <div @click="addCount">{{count}}</div>
</template>

<script>
import { reactive, toRefs } from '@vue/reactivity'
import { onMounted, onUpdated } from '@vue/runtime-core';
export default {
    setup(){
        const state = reactive({
            count:1,
            addCount(){
                state.count++
            }
        })
        const refState = toRefs(state);
        onMounted(()=>{
            console.log("onMounted")
            state.count = 4
        })
        onUpdated(()=>{
            console.log("onUpdated")
        })
        return{
            ...refState
        }
    }
}
</script>

<style>

</style>